package chapter04.chapetr04.Example01;
class Animal{
    private String name;
    private int age;
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public int getAge(){
        return age;
    }
    public void SetAge(int age){
        this.age = age;
    }
}
//定义Dog类继承Animal类
class Dog extends Animal{
    //此处不写任何代码
}
//定义测试
public class Example01 {
    public static void main(String[] Args){
        Dog dog = new Dog();
        dog.setName("牧羊犬");
        dog.SetAge(3);
        System.out.println("名称："+dog.getName()+",年龄："+dog.getAge());
    }

}
